<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	  <title>{$seo_title}</title>
	  <meta name="author" content="YzmCMS内容管理系统">
	  <meta name="keywords" content="{$keywords}" />
	  <meta name="description" content="{$description}" />
	  <link href="{STATIC_URL}css/yzm-common.css" rel="stylesheet" type="text/css" />
	  <link href="{STATIC_URL}css/yzm-form.css" rel="stylesheet" type="text/css" />
	  <link href="{STATIC_URL}iconfont/iconfont.css" rel="stylesheet" type="text/css" />
	  <script type="text/javascript" src="{STATIC_URL}js/jquery-1.8.2.min.js"></script>
	  <script type="text/javascript" src="{STATIC_URL}js/yzm-front.js"></script>
	  <script type="text/javascript" src="{STATIC_URL}plugin/layer/layer.js"></script>
	  <script type="text/javascript" src="{STATIC_URL}js/yzm_common.js"></script>
  </head>
  <body>
	{m:include "index","header"} 
			 <div class="yzm-content-box yzm-form-box">
		 		<div class="yzm-title">
		 			<h2>{$title}</h2>
		 			<span class="yzm-title-right">
		 				当前位置：{$location}
		 			</span>
		 		</div>
				<form action="{U('diyform/index/post')}" method="post" onsubmit="return checkall(this)">
					<input type="hidden" name="modelid" value="{$modelid}">
					<table class='yzm-table'>
						{loop $fieldstr $val}		
						<tr>
							<td class="yzm-table-title">{$val[field]}：</td>
							<td>{$val[form]}</td>
						</tr>
						{/loop}
						{if $modelinfo['check_code']}
				        <tr>
				            <td class="yzm-table-title"><span class="required">*</span>验证码：</td>
				            <td>
				            	<input name="code" type="text" class="yzm-input-text" style="width:100px;">
				            	<img src="{U('api/index/code')}" onclick="this.src=this.src+'?'" class="yzm-code" title="看不清？点击更换">
				            </td>
				        </tr>
						{/if}		
						<tr>
							<td></td>
							<td><input type="submit" name="dosubmit" value="确认提交" class="yzm-submit"></td>
						</tr>
					</table>
				</form> 
			</div>
		</div>
	<script type="text/javascript">

		function checkall(obj){

			//form必填字段的验证
			{loop $field_check $k=>$v}
				{if $v['isrequired'] && !in_array($v['fieldtype'], array('images','attachments','checkbox','editor','editor_mini'))}
				if(obj.{$k}.value==''){
					layer.msg("{$v[errortips]}", {icon:2});
					return false;
				}
				{/if}		
			{/loop}
				
			//验证码的验证
			if(obj.code.value==''){
				layer.msg("验证码不能为空!", {icon:2});
				return false;
			}
			return true;
		}
	</script>		 
	{m:include "index","footer"} 